// 导入axios实例
import httpRequest from '../axios'

// 定义接口的传参和请求
/**
interface UserInfoParam {
	userID: string,
	userName: string
}
export function apiGetUserInfo(param: UserInfoParam) {
    return httpRequest({
		url: '/index/get/indexTw',
		method: 'get',
		data: param,
	})
}
 */
//查询全部
export function apiGetTw() {
    return httpRequest({
		url: '/index/get/indexTw',
		method: 'get',
	})
}
//根据id查询单个
export function twOne(twId) {
    return httpRequest({
		url: '/index/get/indexTw/'+twId,
		method: 'get',
	})
}
interface twForm {
	twText: string
}
interface twForm2 {
	id: number,
	twText: string
}
//增加一个
export function twAdd(param: twForm) {
    return httpRequest({
		url: '/index/post/addTw',
		method: 'post',
		data: param
	})
}
//删除一个
export function twDelete(twId) {
    return httpRequest({
		url: '/index/get/deleteTw/'+twId,
		method: 'get',
	})
}
//修改一个
export function twEdit(param: twForm2) {
    return httpRequest({
		url: '/index/post/editTw',
		method: 'post',
		data: param
	})
}